package MySQL::Query::Performance::Count;

use strict;
use warnings;
use Carp;
use Storable qw(dclone);
use SQL::Builder::Function;

sub new {
    	my ($class , %arg) = @_;
	
	my $self = bless { }, $class;
	return $self;
}

sub create_count_sql {
	my ($self , $sql_builder) = @_;
	# sql_builder object should not contain any unknown fileds
	# PARAM_MAKER | IDENT
	
        my $temp_sql = dclone($sql_builder);
        
	$temp_sql->cols->list_clear; 
        $temp_sql->orderby->list_clear;
	$temp_sql->groupby->list_clear;
	
        my $func = SQL::Builder::Function->new();
	$func->name("COUNT");
	$func->args->list_push("*");
	
	$temp_sql->cols->list_push($func);
	
        return $temp_sql;
}

1;

=head1 NAME

MySQL::Query::Performance::Count

=head1 SYNOPSIS
	
=head1 DESCRIPTION

=head1 METHODS

=head2 new()

=head2 create_count_sql()


